package com.example.demo;

public class DecoratorDemo {
    public static void main(String[] args) {
        Drawable flower = new Flower();
        flower=new Mount(flower);
        flower=new Hook(flower);
        System.out.println(flower.draw());
    }

    public static class Hook implements Drawable{
        private Drawable drawable;

        public static void main(String[] args) {
            Hook(Drawable drawable){
                this.drawable=drawable;
            }
        }

        public String draw(){
            return "---|---\n" +drawable.draw();
        }
    }

    private static class Drawable {
        protected String draw() {

        }
    }

    private static class Flower extends Drawable {
    }

    private static class Mount extends Drawable {
        public Mount(Drawable flower) {
            super();
        }
    }
}
